home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_item_yerbita.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  114 lines

  1. # Jones 3D Cog Script
  2. #
  3. # item_Yerbita.cog
  4. #
  5. # [RT]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ===================================================================
  10.  
  11. symbols
  12.  
  13. message    activated
  14. message    touched
  15. message    taken
  16. message    user0
  17.  
  18. cog        talkCog                    local
  19.  
  20. sound    foundSnd=INXJ156.wav    local
  21.  
  22. thing    player                    local
  23.  
  24. int        bin=39                    local
  25.  
  26. flex    health=333.33            local
  27.  
  28. end
  29.  
  30. # ===================================================================
  31.  
  32. code
  33.  
  34. activated:
  35.  
  36.     StartCutscene(0);
  37.  
  38.     talkCog = GetCogByIndex(0);
  39.     SendMessage(talkCog, 27);
  40.  
  41.     if (Rand() < 0.5)
  42.     {
  43.         SetExtCamOffset('0.15 -0.05 0.04');
  44.     }
  45.     else
  46.     {
  47.         SetExtCamOffset('-0.15 -0.05 0.04');
  48.     }
  49.     SetExtCamLookOffset('0.0 0.02 -0.01');
  50.  
  51.     return;
  52.  
  53. # -------------------------------------------------------------------
  54.  
  55. touched:
  56.  
  57.     player = GetSourceRef();
  58.  
  59.     if (GetInv(player, bin) < GetInvMax(player, bin))
  60.     {
  61.         TakeItem(GetSenderRef(), player);
  62.     }
  63.     else
  64.     {
  65.         EndCutscene();
  66.     }
  67.     
  68.     return;
  69.  
  70. # -------------------------------------------------------------------
  71.  
  72. taken:
  73.  
  74.     player = GetSourceRef();
  75.  
  76.     ChangeInv(player, bin, 1.0);
  77.     SetInvAvailable(player, bin, 1);
  78.     JonesInvItemChanged(bin);
  79.  
  80.     Sleep(1.0);
  81.     PlayVoice(player, foundSnd, 1.0, 0);
  82.  
  83.     EndCutscene();
  84.  
  85.     return;
  86.  
  87. # -------------------------------------------------------------------
  88.  
  89. user0:
  90.  
  91.     player = GetLocalPlayerThing();
  92.  
  93.     if (GetInv(player, bin) > 0)
  94.     {
  95.         if (GetHealth(player) < 1000)
  96.         {
  97.             # Clear the poisoned bit just in case
  98.             ClearActorFlags(player, 0x2000);
  99.  
  100.             # Use the health kit
  101.             HealThing(player, health);
  102.             ChangeInv(player, bin, -1);
  103.             
  104.             if (GetInv(player, bin) == 0)
  105.             {
  106.                 SetInvAvailable(player, bin, 0);
  107.             }
  108.         }
  109.     }
  110.     
  111.     return;
  112.  
  113. end
  114.